home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #2 / Monster Media No. 2 (Monster Media)(1994).ISO / unix / xf86read.zip / VMODES.DOC < prev    next >
Text File  |  1994-07-26  |  51KB  |  1,112 lines

  1.         The Hitchhiker's Guide to X386/XFree86 Video Timing
  2.             (or, Tweaking your Monitor for Fun and Profit)
  3.  
  4. (from an original by Chin Fang <fangchin@leland.stanford.edu>;
  5.     portions derive from a how-to by Bob Crosson <crosson@cam.nist.gov>,
  6.     as revised and expanded by Eric S. Raymond <esr@snark.thyrsus.com>;
  7.  
  8. This is version 1.0, Jan 8th 1993.  Please direct comments, criticism,
  9. and suggestions for improvement to esr@snark.thyrsus.com.
  10.  
  11. Contents:
  12.  
  13. 1. Introduction
  14. 2. How Video Displays Work
  15. 3. Basic Things to Know about your Display and Adapter
  16. 4. Interpreting the Basic Specifications
  17. 5. Tradeoffs in Configuring your System
  18. 6. Memory Requirements
  19. 7. Computing Frame Sizes
  20. 8. Black Magic and Sync Pulses
  21. 9. Putting it All Together
  22. 10. Questions and Answers
  23. 11. Two More Example Calculations
  24. 12. Fixing Problems with the Image.
  25.  
  26. 1. Introduction
  27.  
  28. The X386 server allows users to configure their video subsystem and thus
  29. encourages best use of existing hardware.  This tutorial is intended to help
  30. you learn how to generate your own timing numbers to make optimum use of your
  31. video card and monitor.
  32.  
  33. We'll present a method for getting something that works, and then show you how
  34. you can experiment starting from that base to develop settings that optimize
  35. for your taste.
  36.  
  37. If you already have a mode that almost works (in particular, if one of
  38. predefined VESA modes gives you a stable display but one that's displaced
  39. right or left, or too small, or too large) you can go straight to the section
  40. on Fixing Problems.  This will enlighten you on ways to tweak the timing
  41. numbers to achieve particular effects.
  42.  
  43. X386 allows you to hot-key between different modes defined in Xconfig (see
  44. X386.man for details).  Use this capabilty to save yourself hassles!  When you
  45. want to test a new mode, give it a unique mode label and add it to the *end*
  46. your hot-key list.  Leave a known-good mode as the default to fall back on if
  47. the test mode doesn't work.  The Xconfig section at the end of the second
  48. Example Calculation provides a good example of how to record your experiments
  49. in a way that will help you quickly converge on a solution.
  50.  
  51. If you have ftp access, check out David Wexelblat's mode database (part of the
  52. XFree86 distribution) available on ftp.x.org in contrib/XF86mode.tar.gz.
  53. If your monitor is in it, you can probably skip the rest of this document!
  54. You may need to scale some of the timing numbers if the clock used to
  55. generate the mode in the database doesn't match what your card has available,
  56. but that's easy.
  57.  
  58. 2. How Video Displays Work
  59.  
  60. Knowing how the display works is essential to understanding what numbers to put
  61. in the various fields in the file Xconfig.  Those values are used in the lowest
  62. levels of controlling the display by the X386 server.
  63.  
  64. The display generates a picture from a series of dots.  The dots are arranged
  65. from left to right to form lines.  The lines are arranged from top to bottom to
  66. form the picture.  The dots emit light when they are struck by the electron
  67. beam inside the display.  To make the beam strike each dot for an equal amount
  68. of time, the beam is swept across the display in a constant pattern.
  69.  
  70. The pattern starts at the top left of the screen, goes across the screen to the
  71. right in a straight line, and stops temporarily on the right side of the
  72. screen.  Then the beam is swept back to the left side of the display, but down
  73. one line.  The new line is swept from left to right just as the first line was.
  74. This pattern is repeated until the bottom line on the display has been swept.
  75. Then the beam is moved from the bottom right corner of the display to the top
  76. left corner, and the pattern is started over again.
  77.  
  78. Starting the beam at the top left of the display is called the beginning of a
  79. frame.  The frame ends when the beam reaches the the top left corner again as
  80. it comes from the bottom right corner of the display.  A frame is made up of
  81. all of the lines the beam traced from the top of the display to the bottom.
  82.  
  83. If the electron beam were on all of the time it was sweeping through the frame,
  84. all of the dots on the display would be illuminated.  There would be no black
  85. border around the edges of the display.  At the edges of the display the
  86. picture would become distorted because the beam is hard to control there.  To
  87. reduce the distortion, the dots around the edges of the display are not
  88. illuminated by the beam even though the beam may be pointing at them.  The
  89. viewable area of the display is reduced this way.
  90.  
  91. Another important thing to understand is what becomes of the beam when no spot
  92. is being painted on the visible area.  The time the beam would have been
  93. illuminating the side borders of the display is used for sweeping the beam back
  94. from the right edge to the left and moving the beam down to the next line.  The
  95. time the beam would have been illuminating the top and bottom borders of the
  96. display is used for moving the beam from the bottom-right corner of the display
  97. to the top-left corner.
  98.  
  99. The adapter card generates the signals which cause the display to turn on the
  100. electron beam at each dot to generate a picture.  The card also controls when
  101. the display moves the beam from the right side to the left and down a line by
  102. generating a signal called the horizontal sync (for synchronization) pulse.
  103. One horizontal sync pulse occurs at the end of every line.  The adapter also
  104. generates a vertical sync pulse which signals the display to move the beam to
  105. the top-left corner of the display.  A vertical sync pulse is generated near
  106. the end of every frame.
  107.  
  108. The display requires that there be short time periods both before and after the
  109. horizontal and vertical sync pulses so that the position of the electron beam
  110. can stabilize.  If the beam can't stabilize, the picture will not be steady.
  111.  
  112. In a later section, we'll come back to these basics with definitions,
  113. formulas and examples to help you use them.
  114.  
  115. 3. Basic Things to Know about your Display and Adapter
  116.  
  117. There are some fundamental things you need to know before hacking an Xconfig
  118. entry.  These are:
  119.  
  120.     (1) your monitor's horizontal and vertical sync frequency options
  121.     (2) your video adapter's driving clock frequency, or "dot clock"
  122.     (3) your monitor's bandwidth
  123.  
  124. The monitor sync frequencies:
  125.  
  126. The horizontal sync frequency are just the number of times per second the
  127. monitor can write a horizontal scan line; it is the single most important
  128. statistic about your monitor.  The vertical sync frequency is the number of
  129. times per second the monitor can traverse its beam vertically.
  130.  
  131. Sync frequencies are usually listed on the specifications page of your monitor
  132. manual.  The vertical sync frequency number is typically calibrated in Hz
  133. (cycles per second), the horizontal one in KHz (kilocycles per second).  The
  134. usual ranges are between 50 and 80Hz vertical, and between 31 and 135KHz
  135. horizontal.
  136.  
  137. If you have a multisync monitor, these frequencies will be given as ranges.
  138. Some monitors, especially lower-end ones, have multiple fixed frequencies.
  139. These can be configured too, but your options will be severely limited by the
  140. built-in monitor characteristics.  Choose the highest frequency pair for best
  141. resolution.  And be careful --- trying to clock a fixed-frequency monitor at a
  142. higher speed than it's designed for can damage it.
  143.  
  144. The card driving clock frequency:
  145.  
  146. Your video adapter manual's spec page will usually give you the card's dot
  147. clock (that is, the total number of pixels per second it can write to the
  148. screen).  If you don't have this information, the X server will get it for
  149. you.  Even if your X locks up your monitor, it will emit a line of clock and
  150. other info to standard output.  If you redirect this to a file, it should be
  151. saved even if you have to reboot to get your console back.
  152.  
  153. If you're using SGCS X, the line will look something like the following
  154. example, collected from a Swan local-bus S3 adapter.  XFree86 uses a slightly
  155. different multi-line format.
  156.  
  157. WGA: 86C911 (mem: 1024k clocks: 25 28 40 3 50 77 36 45 0 0 79 31 94 65 75 71)
  158. ---  ------       -----         --------------------------------------------
  159.  |     |            |                 Possible driving frequencies in MHz
  160.  |     |            +-- Size of on-board frame-buffer RAM
  161.  |     +-- Chip type
  162.  +-- Server type
  163.  
  164. Note: do this with your machine unloaded (if at all possible).  Because X is
  165. an application, its timing loops can collide with disk activity, rendering the
  166. numbers above inaccurate.  Do it several times and watch for the numbers to
  167. stabilize; if they don't, start killing processes until they do.  SVr4 users:
  168. the mousemgr process is particularly likely to mess you up. 
  169.  
  170. In order to avoid the clock-probe inaccuracy, you should clip out the clock
  171. timings and put them in your Xconfig as the value of the Clocks property ---
  172. this suppresses the timing loop and gives X an exact list of the clock values
  173. it can try.  Using the data from the example above:
  174.  
  175. wga
  176.     Clocks    25 28 40 3 50 77 36 45 0 0 79 31 94 65 75 71
  177.  
  178. On systems with a highly variable load, this may help you avoid mysterious X
  179. startup failures.  It's possible for X to come up, get its timings wrong due
  180. to system load, and then not be able to find a matching dot clock in its
  181. config database --- or find the wrong one!
  182.  
  183. The monitor's video bandwidth:
  184.  
  185. Finally, it's useful to know your monitor's video bandwidth, so you know
  186. approximately what the highest dot clock you can use is.  There's a lot of
  187. give here, though --- some monitors can run as much as 30% over their nominal
  188. bandwidth.
  189.  
  190. Knowing the bandwidth will enable you to make more intelligent choices between
  191. possible configurations.  It may affect your display's visual quality (esp.
  192. sharpness for fine details).
  193.  
  194. Your monitor's video bandwidth should be included on the manual's spec page.
  195. If it's not, look at the monitor's higest rated resolution.  As a rule of
  196. thumb, here's how to translate these into bandwidth estimates (and thus into
  197. rough upper bounds for the dot clock you can use):
  198.  
  199.     640x480            25
  200.     800x600            36
  201.     1024x768        65
  202.     1024x768 interlaced    45
  203.     1280x1024        110
  204.  
  205. BTW, there's nothing magic about this table; these numbers are just the lowest
  206. dot clocks per resolution in the standard X386 Modes database.  The bandwidth
  207. of your monitor may be higher than the minimum needed for its top resolution,
  208. so don't be afraid to try a dot clock a few MHz higher.
  209.  
  210. Also note that bandwidth is seldom an issue for dot clocks under 65MHz or so.
  211. With an SVGA and most hi-res monitors, you can't get anywhere near the limit
  212. of your monitor's video bandwidth.  The following are examples:
  213.  
  214.     Brand                Video Bandwidth
  215.     ----------            ---------------
  216.     NEC 4D                75Mhz
  217.     Nano 907a            50Mhz
  218.     Nano 9080i            60Mhz
  219.     Mitsubishi HL6615        110Mhz
  220.     Mitsubishi Diamond Scan        100Mhz
  221.     IDEK MF-5117            65Mhz
  222.     IOCOMM Thinksync-17 CM-7126    136Mhz
  223.     HP D1188A            100Mhz
  224.     Philips SC-17AS            110Mhz
  225.     Swan SW617            85Mhz
  226.  
  227. Even low-end monitors usually aren't terribly bandwidth-constrained for their
  228. rated resolutions.  The NEC Multisync II makes a good example --- it can't
  229. even display 800x600 per its spec.  It can only display 800x560.  For such low
  230. resolutions you don't need high dot clocks or a lot of bandwidth; probably the
  231. best you can do is 32Mhz or 36Mhz, both of them are still not too far from the
  232. monitor's rated video bandwidth of 30Mhz.
  233.  
  234. At these two driving frequencies, your screen image may not be as sharp as it
  235. should be, but definitely of tolerable quality. Of course it would be nicer if
  236. NEC Multisync II had a video bandwidth higher than, say, 36Mhz.  But this is
  237. not critical for common tasks like text editing, as long as the difference is
  238. not so significant as to cause severe image distortion (your eyes would tell
  239. you right away if this were so).
  240.  
  241. What these control:
  242.  
  243. The sync frequency ranges of your monitor, together with your video adapter's
  244. dot clock, determine the ultimate resolution that you can use.  But it's up to
  245. the driver to tap the potential of your hardware.  A superior hardware
  246. combination without an equally competent device driver is a waste of money.
  247. On the other hand, with a versatile device driver but less capable hardware,
  248. you can push the hardware's envelope a little.  This is the design philosophy
  249. of X386.
  250.  
  251. 4. Interpreting the Basic Specifications
  252.  
  253. This section explains what the specifications above mean, and some other
  254. things you'll need to know.  First, some definitions.  Next to each in parens
  255. is the variable name we'll use for it when doing calculations
  256.  
  257. horizontal sync frequency (HSF)
  258.     Horizontal scans per second (see above).
  259.  
  260. vertical sync frequency (VSF)
  261.     Vertical scans per second (see above).  Mainly important as the upper
  262. limit on your refresh rate.
  263.  
  264. dot clock  (DCF)
  265.     More formally, `driving clock frequency'; sometimes loosely called
  266. `bandwidth'.  The frequency of the crystal or VCO on your adaptor --- the
  267. maximum dots-per-second it can emit.
  268.  
  269. video bandwidth (VB)
  270.     The highest frequency at which your monitor's video signal can change.
  271. This constrains the highest dot clock you can use and the overall sharpness
  272. of fine details in the video image.
  273.  
  274. frame length (HFL, VFL)
  275.     Horizontal frame length (HFL) is the number of dot-clock ticks needed for
  276. your monitor's electron gun to scan one horizontal line, *including the
  277. inactive left and right borders*.  Vertical frame length (VFL) is the number
  278. of scan lines in the *entire* image, including the inactive top and bottom
  279. borders.
  280.  
  281. screen refresh rate (RR)
  282.    The number of times per second your screen is repainted.  Higher frequencies
  283. are better, as they reduce flicker.  60Hz is good, VESA-standard 72Hz is
  284. better.  Compute it as 
  285.  
  286.     RR = DCF / (HFL * VFL)
  287.  
  288. Note that the product in the denominator is *not* the same as the monitor's
  289. visible resolution, but typically somewhat larger.  We'll get to the details
  290. of this below.
  291.  
  292. About Bandwidth:
  293.  
  294. Monitor makers like to advertise high bandwidth because it constrains the
  295. sharpness of intensity and color changes on the screen.  A high bandwidth
  296. means smaller visible details.
  297.  
  298. Your monitor uses electronic signals to present an image to
  299. your eyes.  Such signals always come in in wave form once they are converted
  300. into analog form from digitized form.  They can be considered as combinations
  301. of many simpler wave forms each one of which has a fixed frequency, many of
  302. them are in the Mhz range, eg, 20Mhz, 40Mhz, or even 70Mhz.  Your monitor
  303. video bandwidth is, effectively, the highest-frequency analog signal it can
  304. handle without distortion.
  305.  
  306. For our purposes, bandwidth is mainly important as an approximate cutoff point
  307. for the highest dot clock you can use.
  308.  
  309. Sync Frequencies snd the Refresh Rate:
  310.  
  311. Each horizontal scan line on the display is just the visible portion of a
  312. frame-length scan.  At any instant there is actually only one dot active on
  313. the screen, but with a fast enough refresh rate your eye's persistence of
  314. vision enables you to "see" the whole image.
  315.  
  316. Here are some pictures to help:
  317.  
  318.                     _______________________
  319.                    |                       |     The horizontal frame length
  320.                    |->->->->->->->->->->-> |     is the time in dot clocks
  321.                    |                      )|     required for the
  322.                    |<-----<-----<-----<--- |     electron beam to trace
  323.                    |                       |     a pattern like this
  324.                    |                       |
  325.                    |                       |
  326.                    |                       |
  327.                    |_______________________|    
  328.  
  329.                     _______________________
  330.                    |        ^              |     The vertical frame length
  331.                    |       ^ |             |     is the time in dot clocks
  332.                    |       | v             |     required for the
  333.                    |       ^ |             |     electron beam to trace
  334.                    |       | |             |     a pattern like this
  335.                    |       ^ |             |
  336.                    |       | v             |
  337.                    |       ^ |             |
  338.                    |_______|_v_____________|    
  339.                 
  340. Remember that the actual raster scan is a very tight zigzag pattern; that is,
  341. the beam moves left <-> right and at the same time up <-> down.
  342.  
  343. Now we can see how the dot clock and frame size relates to refresh rate.  By
  344. definition, one hertz (hz) is one cycle per second.  So, if your horizontal
  345. frame length is HFL and your vertical frame length is VFL, then to cover the
  346. entire screen takes (HFL * VFL) ticks.  Since your card emits DCF ticks per
  347. second by definition, then obviously your monitor's electron gun(s) can sweep
  348. the screen from left to right and back and from bottom to top and back DCF /
  349. (HFL * VFL) times/sec.  This is your screen's refresh rate, because it's how
  350. many times your screen can be updated thus REFRESHED per second!
  351.  
  352. You need to understand this concept to design a configuration which trades off
  353. resolution against flicker in whatever way suits your needs.
  354.  
  355. 5. Tradeoffs in Configuring your System
  356.  
  357. Another way to look at the formula we derived above is
  358.  
  359.     DCF = RR * HFL * VFL
  360.  
  361. That is, your dot clock is fixed.  You can use those dots per second to buy 
  362. either refresh rate, horizontal resolution, or vertical resolution.  If one
  363. of those increases, one or both of the others must decrease.
  364.  
  365. Note, though, that your refresh rate cannot be greater than the maximum
  366. vertical sync frequency of your monitor.  Thus, for any given monitor at a
  367. given dot clock, there is a minimum product of frame lengths below which you
  368. can't force it.
  369.  
  370. In choosing your settings, remember: if you set RR too low, you will get
  371. mugged by screen flicker.
  372.  
  373. You probably do not want to pull your refresh rate below 60Hz.  This is the
  374. flicker rate of fluorescent lights; if you're sensitive to those, you need
  375. to hang with 72MHz, the VESA ergonomic standard.
  376.  
  377. Flicker is very eye-fatiguing, though human eyes are adaptable and peoples'
  378. tolerance for it varies widely.  If you face your monitor at a 90% viewing
  379. angle, are using a dark background and a good contrasting color for
  380. foreground, and stick with low to medium intensity, you *may* be comfortable
  381. at as little as 45Hz.
  382.  
  383. The acid test is this: open a xterm with pure white back-ground and black
  384. foreground using xterm -bg white -fg black and make it so large as to cover the
  385. entire viewable area.  Now turn your monitor's intensity to 3/4 of its maximum
  386. setting, and turn your face away from the monitor.  Try peeking at your monitor
  387. sideways (bringing the more sensitive peripheral-vision cells into play).  If
  388. you don't sense any flicker or if you feel the flickering is tolerable, then
  389. that refresh rate is fine with you.  Otherwise you better configure a higher
  390. refresh rate, because that semi-invisible flicker is going to fatigue your eyes
  391. like crazy and give you headaches, even if the screen looks OK to normal
  392. vision.
  393.  
  394. So let's say you've picked a minimum acceptable refresh rate.  In choosing
  395. your HFL and VFL, you'll have some room for maneuver.
  396.  
  397. 6. Memory Requirements
  398.  
  399. Available frame-buffer RAM may limit the resolution you can achieve on color or
  400. gray-scale displays.  It probably isn't a factor on displays that have only two
  401. colors, white and black with no shades of gray in between.
  402.  
  403. For 256-color displays, a byte of video memory is required for each visible
  404. dot to be shown.  This byte contains the information that determines what mix
  405. of red, green, and blue is generated for its dot.  To get the amount of memory
  406. required, multiply the number of visible dots per line by the number of
  407. visible lines.  For a display with a resolution of 800x600, this would be 800
  408. x 600 = 480,000, which is the number of visible dots on the display.  This is
  409. also, at one byte per dot, the number of bytes of video memory that are
  410. necessary on your adapter card.
  411.  
  412. Thus, your memory requirement will typically be (HR * VR)/1024 Kbytes of VRAM,
  413. rounded up.  In the example case, we'd need (936 * 702)/1024 = 642K.  So if
  414. you have one meg, you'll have extra for virtual-screen panning.
  415.                  
  416. However, if you only have 512K on board, then you can't use this resolution.
  417. Even if you have a good monitor, without enough video ram, you can't take
  418. advantage of your monitor's potential.  On the other hand, if your SVGA has one
  419. meg, but your monitor can display at most 800x600, then high resolution is
  420. beyond your reach anyway.
  421.  
  422. Don't worry if you have more memory than required; X386 will make use of it by
  423. allowing you to scroll your viewable area (see the Xconfig file documentation
  424. on the virtual screen size parameter).  Remember also that a card with 512K
  425. bytes of memory really doesn't have 512,000 bytes installed, it has 512 x 1024
  426. = 524,288 bytes.
  427.  
  428. If you're running SGCS X using an S3 card, and are willing to live with 16
  429. colors (4 bits per pixel), you can set depth 4 in Xconfig and effectively double
  430. the resolution your card can handle.  S3 cards, for example, normally do
  431. 1024x768x256.  You can make them do 1280x1024x16 with depth 4.
  432.  
  433. 7. Computing Frame Sizes
  434.  
  435. Warning: this method was developed for multisync monitors.  It will probably
  436. work with fixed-frequency monitors as well, but no guarantees!
  437.  
  438. Start by dividing DCF by your highest available HSF to get the number
  439. of horizontal sweeps per second available.
  440.  
  441. For example; suppose you have a Sigma Legend SVGA with a 65MHz dot clock, and
  442. your monitor has a 55KHz horizontal scan frequency.  The quantity (DCF / HSF)
  443. is then 1181.
  444.  
  445. Now for our first bit of black magic.  You need to round this figure to the
  446. nearest multiple of 8.  This has to do with the VGA hardware controller used by
  447. SVGA and S3 cards; it uses an 8-bit register, left-shifted 3 bits, for what's
  448. really an 11-bit quantity.  Other card types such as ATI 8514/A may not have
  449. this requirement, but we don't know and the correction can't hurt.  So round
  450. the usable horizontal scans per second figure to 1176.
  451.  
  452. This figure (DCF / HSF rounded to a multiple of 8) is the minimum HFL you can
  453. use.  You can get longer HFLs (and thus, possibly, more horizontal dots on the
  454. screen) by setting the sync pulse to produce a lower HSF.  But you'll pay with
  455. a slower and more visible flicker rate.
  456.  
  457. As a rule of thumb, 80% of the horizontal frame length is available for
  458. horizontal resolution, the visible part of the horizontal scan line (this
  459. allows, roughly, for borders and sweepback time -- that is, the time required
  460. for the beam to move from the right screen edge to the left edge of the next
  461. raster line).  In this example, that's 944 ticks.
  462.  
  463. Now, to get the normal 4:3 screen aspect ratio, set your vertical resolution
  464. to 3/4ths of the horizontal resolution you just calculated.   For this
  465. example, that's 708 ticks.  To get your actual VFL, multiply that by 1.05
  466. to get 743 ticks.
  467.  
  468. About that 4:3 --- a ratio of 4:3 for width to height of the displayed area
  469. approximates the Golden Section, (1 + sqrt(5))/2.  Human beings seem to be
  470. wired to find this kind of rectangle pleasant to look at; accordingly, video
  471. tubes and the standard resolutions such as 800x600, 640x480 and 1024x768 all
  472. approximate it.  Though it's psychologically magic, it's not technically
  473. magic; nothing prevents you from using a non-Golden-Section ratio if that
  474. will get the best use out of your screen real estate.
  475.  
  476. So, HFL=1176 and VFL=743.  Dividing 65MHz by the product of the two gives
  477. us a nice, healthy 74.4Hz refresh rate.  Excellent!  Better than VESA standard!
  478. And you got 944x708 to boot, more than the 800 by 600 you were probably
  479. expecting.  Not bad at all!
  480.  
  481. You can even improve the refresh rate further, to almost 76 Hz, by using the
  482. fact that monitors can often sync horizontally at 2khz or so higher than
  483. rated, and by lowering VFL somewhat (that is, taking less than 75% of 944 in
  484. the example above).  But before you try this "overdriving" maneuver, if you
  485. do, make *sure* that your monitor electron guns can sync up to 76 Hz vertical.
  486. (the popular NEC 4D, for instance, cannot.  It goes only up to 75 Hz VSF).
  487.  
  488. So far, most of this is simple arithematic and basic facts about raster
  489. displays.  Hardly any black magic at all!
  490.  
  491. 8. Black Magic and Sync Pulses
  492.  
  493. OK, now you've computed HFL/VFL numbers for your chosen dot clock, found the
  494. refresh rate acceptable, and checked that you have enough VRAM.  Now for the
  495. real black magic -- you need to know when and where to place synchronization
  496. pulses.
  497.  
  498. The sync pulses actually control the horizontal and vertical scan frequebcies
  499. of the monitor.  The HSF and VSF you've pulled off the spec sheet are nominal,
  500. approximate maximum sync frequencies.  The sync pulse in the signal from the
  501. adapter card tells the monitor how fast to actually run.
  502.  
  503. Recall the two pictures above?  Only part of the time required for
  504. raster-scanning a frame is used for displaying viewable image (ie. your
  505. resolution).
  506.  
  507. Horizontal Sync:
  508.  
  509. By previous definition, it takes HFL ticks to trace the a horizontal scan line.
  510. Let's call the visible tick count (your horizontal screen resolution) HR.  Then
  511. Obviously, HR < HFL by definition.  For concreteness, let's assume both start
  512. at the same instant as shown below:
  513.  
  514.                   |___ __ __ __ __ __ __ __ __ __ __ __ __
  515.                   |_ _ _ _ _ _ _ _ _ _ _ _                |
  516.                   |_______________________|_______________|_____ 
  517.                   0                       ^               ^     unit: ticks
  518.                                           |   ^       ^   |
  519.                                           HR  |       |  HFL
  520.                                           |   |<----->|   |
  521.                                           |<->|  HSP  |<->|
  522.                                            HGT1         HGT2
  523.  
  524.                   
  525. Now, we would like to place a sync pulse of length HSP as shown above, ie,
  526. between the end of clock ticks for display data and the end of clock ticks for
  527. the entire frame.  Why so?  because if we can achieve this, then your screen
  528. image won't shift to the right or to the left.  It will be where it supposed to
  529. be on the screen, covering squarely the monitor's viewable area.
  530.  
  531. Furthermore, we want about 30 ticks of "guard time" on either side of the sync
  532. pulse.  This is represented by HGT1 and HGT2.  In a typical configuration HGT1
  533. != HGT2, but if you're building a configuration from scratch, you want to start
  534. your experimentation with them equal (that is, with the sync pulse centered).
  535.  
  536. The symptom of a misplaced sync pulse is that the image is displaced on the
  537. screen, with one border excessively wide and the other side of the image
  538. wrapped around the screen edge, producing a white edge line and a band of
  539. "ghost image" on that side.  A way-out-of-place vertical sync pulse can
  540. actually cause the image to roll like a TV with a mis-adjusted vertical hold
  541. (in fact, it's the same phenomenon at work).
  542.  
  543. If you're lucky, your monitor's sync pulse widths will be documented on its
  544. specification page.  If not, here's where the real black magic starts...
  545.  
  546. You'll have to do a little trial and error for this part.  But most of the
  547. time, we can safely assume that a sync pulse is about 3.5 to 4.0 microsecond
  548. in length.
  549.  
  550. For concretness again, let's take HSP to be 3.8 microseconds (which btw, is not
  551. a bad value to start with when experimenting).
  552.  
  553. Now, using the 65Mhz clock timing above, we know HSP is equivalent to 247 clock
  554. ticks (= 65x10**6 * 3.8 *10**(-6)) [recall M=10**6, micro=10**(-6)]
  555.  
  556. Vertical Sync:
  557.  
  558. Going back to the picture above, how do we place the 247 clock ticks as shown
  559. in the picture?
  560.  
  561. Using our example, HR is 944 and HFL is 1176.  The difference between the two
  562. is 1176-944=232 < 247!  Obviously we have to do some adjustment here.  What can
  563. we do?
  564.  
  565. The first thing is to raise 1176 to 1184, and lower 944 to 936.  Now the
  566. difference = 1184-936= 248. Hmm, closer.
  567.  
  568. Next, instead using 3.8, we use 3.5 for calculating HSP; then, we have
  569. 65*3.5=227.  Looks better.  But 248 is not much higher than 227.  It's normally
  570. necessary to have 30 or so clock ticks between HR and the start of SP, and the
  571. same for the end of SP and HFL.  AND they have to be multiple of eight!  Are we
  572. stuck?
  573.  
  574. No!  let's do this, 936%8==0, (936+32)%8==0 too.  But 936+32=968, 968+227=1195,
  575. 1195+32=1227.  Hmm.. this looks not too bad.  But it's not a multiple of 8, so
  576. lets round it up to 1232.
  577.  
  578. But now we have potential trouble, the sync pulse is no longer placed right in
  579. the middle between h and H any more.  Happily, using our calculator we find
  580. 1232-32=1200 is also a multiple of 8 and (1232-32)-968=232 corresponding using
  581. a sync pulse of 3.57 micro second long, still reasonable.
  582.  
  583. In addition, 936/1232~0.76 or 76%, still not far from 80%, so it should be all
  584. right.
  585.  
  586. Furthermore, using the current horizontal frame length, we basically ask our
  587. monitor to sync at 52.7khz(=65Mhz/1232) which is within its capability.  No
  588. problems.
  589.                 
  590. Using rules of thumb we mentioned before, 936*75%=702, This is our new vertical
  591. resolution.  702*1.05=737, our new vertical frame length.
  592.  
  593. Screen refresh rate = 65Mhz/(737*1232)=71.6 Hz.  This is still excellent.
  594.  
  595. Figuring the vertical sync pulse layout is similar:
  596.  
  597.                   |___ __ __ __ __ __ __ __ __ __ __ __ __
  598.                   |_ _ _ _ _ _ _ _ _ _ _ _                |
  599.                   |_______________________|_______________|_____ 
  600.                   0                      VR              VFL     unit: ticks
  601.                                           ^   ^       ^
  602.                                           |   |       |
  603.                                           |<->|<----->|
  604.                                            VGT    VSP
  605.                 
  606. We start the sync pulse just past the end of the vertical display data ticks.
  607. VGT is the vertical guard time required for the sync pulse.  Most monitors are
  608. comfortable with a VGT of 0 (no guard time) and we'll use that in this
  609. example.  A few need two or three ticks of guard time, and it usually doesn't
  610. hurt to add that.
  611.  
  612. Returning to the example: since by the defintion of frame length, a vertical
  613. tick is the time for tracing a complete HORIZONTAL frame, therefore in our
  614. example, it is 1232/65Mhz=18.95us.
  615.  
  616. Experience shows that a vertical sync pulse should be in the range of 50us and
  617. 300us.  As an example let's use 150us, which translates into 8 vertical clock
  618. ticks (150us/18.95us~8).
  619.  
  620. 9. Putting it All Together
  621.  
  622. The Xconfig file Table of Video Modes contains lines of numbers, with each line
  623. being a complete specification for one mode of X-server operation.  The fields
  624. are grouped into four sections, the name section, the clock frequency section,
  625. the horizontal section, and the vertical section.
  626.  
  627. The name section contains one field, the name of the video mode specified by
  628. the rest of the line.  This name is referred to on the "Modes" line of the
  629. Graphics Driver Setup section of the Xconfig file.  The name field may be
  630. omitted if the name of a previous line is the same as the current line.
  631.  
  632. The dot clock section contains only the dot clock (what we've called DCF) field
  633. of the video mode line.  The number in this field specifies what dot clock was
  634. used to generate the numbers in the following sections.
  635.  
  636. The horizontal section consists of four fields which specify how each
  637. horizontal line on the display is to be generated.  The first field of the
  638. section contains the number of dots per line which will be illuminated to form
  639. the picture (what we've called HR).  The second field of the section indicates
  640. at which dot the horizontal sync pulse will begin.  The third field indicates
  641. at which dot the horizontal sync pulse will end.  The fourth field specifies
  642. the toal horzontal frame length (HFL).
  643.  
  644. The vertical section also contains four fields.  The first field contains the
  645. number of visible lines which will appear on the display (VR).  The second
  646. field indicates the line number at which the vertical sync pulse will begin.
  647. The third field specifies the line number at which the vertical sync pulse will
  648. end.  The fourth field contains the total vertical frame length (VFL).
  649.  
  650. Example:
  651.  
  652.      #Modename    clock  horizontal timing  vertical timing
  653.  
  654.      "752x564"     40    752 784  944 1088  564 567 569 611
  655.                44.5  752 792  976 1240  564 567 570 600
  656.  
  657. (Note: stock X11R5 doesn't support fractional dot clocks.)
  658.  
  659. For Xconfig, all of the numbers just mentioned - the number of illuminated dots
  660. on the line, the number of dots separating the illuminated dots from the
  661. beginning of the sync pulse, the number of dots representing the duration of
  662. the pulse, and the number of dots after the end of the sync pulse - are added
  663. to produce the number of dots per line.  The number of horizontal dots must be
  664. evenly divisible by eight.
  665.  
  666. Example:
  667.  
  668.      horizontal numbers: 800 864 1024 1088
  669.  
  670.      The sample line has the number of illuminated dots
  671.      (800) followed by the number of the dot when the sync
  672.      pulse starts (864), followed by the number of the dot
  673.      when the sync pulse ends (1024), followed by the number
  674.      of the last dot on the horizontal line (1088).
  675.  
  676. Note again that all of the horizontal numbers (800, 864, 1024, and 1088) are
  677. divisible by eight!  This is not required of the vertical numbers.
  678.  
  679. The number of lines from the top of the display to the bottom form the frame.
  680. The basic timing signal for a frame is the line.  A number of lines will
  681. contain the picture.  After the last illuminated line has been displayed, a
  682. delay of a number of lines will occur before the vertical sync pulse is
  683. generated.  Then the sync pulse will last for a few lines, and finally the last
  684. lines in the frame, the delay required after the pulse, will be generated.  The
  685. numbers that specify this mode of operation are entered in a manner similar to
  686. the following example.
  687.  
  688. Example:
  689.  
  690.      vertical numbers: 600 603 609 630
  691.  
  692.      This example indicates that there are 600 visible lines
  693.      on the display, that the vertical sync pulse starts
  694.      with the 603rd line and ends with the 609th, and that
  695.      there are 630 total lines being used.
  696.  
  697. Note that the vertical numbers don't have to be divisible by eight!
  698.  
  699.    Let's return to the example we've been working.  According to the above, all
  700. we need to do from now on is to write our result into Xconfig as follows:
  701.  
  702. <name>   DCF     HR  SH1 SH2   HFL   VR  SV1 SV2 VFL
  703.  
  704. where SH1 is the start tick of the horizontal sync pulse and SH2 is its end
  705. tick; similarly, SV1 is the start tick of the vertical sync pulse and SV2 is
  706. its end tick.
  707.  
  708. #name    clock   horizontal timing   vertical timing    flag
  709. 936x702  65      936 968 1200 1232   702 702 710 737
  710.  
  711. No special flag necessary; this is a non-interlaced mode.  Now we are really
  712. done.
  713.  
  714. 10. Questions and Answers
  715.  
  716.    Q. The example you gave is not a standard screen size, can I use it?
  717.    A. Why not?  There is NO reason whatsover why you have to use 640x480,
  718. 800x600, or even 1024x768.  X386 driver lets you config your hardware with a
  719. lot of freedom.  It usually takes two to three minutes to come up the right
  720. one.  The important thing to shoot for is high refresh rate with reasonable
  721. viewing area. not high resolution at the price of eye-tearing flicker!
  722.  
  723.    Q. It this the *only* resolution given the 65Mhz dot clock and 55Khz HSF?
  724.    A. Absolutely not!  You are encouraged to follow the general procedure and
  725. do some trial-and-error to come up with a setting that's really to your liking.
  726. Experimenting with this can be lots of fun.  Most settings may just give you
  727. nasty video hash, but nothing you do can actually damage a multi-sync monitor
  728. (unless you somehow force your card to clock it at way above its bandwidth ---
  729. if you stick reasonably close to the highest resolution the monitor is
  730. documented to support this can't happen).
  731.    Beware fixed-frequency monitors!  This kind ofhacking around *can* damage
  732. them.
  733.  
  734.    Q. You just mentioned two standard resolutions. In Xconfig, there are many
  735. standard resolutions available, can you tell me whether there's any point in
  736. tinkering with timings?
  737.    A. Absolutely!  Take, for example, the "standard" 640x480 listed in the
  738. current Xconfig.  It employes 25Mhz driving frequency, frame lengths are 800
  739. and 525 => refresh rate ~ 59.5Hz. Not too bad.  But 28Mhz is a commonly
  740. available driving frequency from many SVGA boards.  If we use it to drive
  741. 640x480, following the procedure we discussed above, you would get frame
  742. lengths like 812 and 505.  Now the refresh rate is raised to 68Hz, a
  743. quite significant improvement over the standard one.  
  744.  
  745.    Q. But how about interlace/non-interlace?
  746.    A. At a fixed dot clock, an interlaced display is going to flicker worse
  747. than a non-interlaced one, which is why the market has moved away from them.
  748. What you buy with the increased flicker is higher resolution with a slower
  749. dot clock.  If the DCF were fast enough (say 90MHz or up) even interlacing
  750. wouldn't produce flicker -- but at present speeds, interlaced monitors are
  751. a bad idea for X.
  752.  
  753.     Q. Can you summarize what we have discussed so far?
  754.     A. In a nutshell:
  755.  
  756.     (1) for any fixed driving frequency, raising max resolution
  757.         incurs the penalty of lowering refresh rate and thus
  758.         introducing more flicker.
  759.  
  760.     (2) if high resolution is desirable and your monitor 
  761.         supports it, try to get a SVGA card that provides
  762.         a matching dot clock or DCF. The higher, the
  763.         better!
  764.  
  765. 11. Two More Example Calculations
  766.  
  767. Here's another hypothetical:
  768.  
  769. An adapter card has a 40 MHz clock rate.  A display has a range of horizontal
  770. sync rates from 30 KHz to 37 KHz.  The minimum number of dots per line is
  771. 40,000,000/37,000 = 1,081.081, or approximately 1,081 dots per line.
  772.  
  773. We'll use this number of dots per line in the following calculations.  So each
  774. line on our display must have at least 1081 dots.  We round this up to 1088 to
  775. make it divisible evenly by eight.  Now let's assume that the horizontal sync
  776. pulse should be 3.8 microseconds long.  We need to find out how many dots it
  777. takes to make a 3.8 microsecond pulse.  We do this by first finding out how
  778. many microseconds are in one dot.  Since there are 40,000,000 dots per second,
  779. 1/40,000,000 is the number of seconds per dot.
  780.  
  781.      1/40,000,000 = .000000025 = .025 microseconds per dot
  782.  
  783.  
  784. Thus the number of dots for a 3.8 microsecond sync pulse is
  785.  
  786.      3.8 microseconds = D dots x .025 microseconds/dot
  787.  
  788.             or
  789.  
  790.      D dots = (3.8 microseconds) / (.025 microseconds/dot) = 152 dots
  791.  
  792. So we have 1088 dots per line, 800 of which are the illuminated ones, with 152
  793. for the sync pulse.  (Note that 152 is evenly divisible by eight.  If it
  794. weren't we would round it up until it was evenly divisible.)  This leaves us
  795. the task of calculating the time before and after the sync pulse that is
  796. necessary for the display.
  797.  
  798. The rule of thumb for this is that we need about 30 ticks of guard time.  In
  799. this particular case, allocating 32 dots is convenient, because all the other
  800. quantities are divisible by 8.  This results in the timing being 800 dots for
  801. the viewable area, 152 dots for the pulse, and 1088 - (800 + 152) = 136 dots
  802. to divide between the two other times.  Half of 136 is 68 dots, so 68 dots are
  803. placed between the illuminated dots and the sync pulse, and 68 dots are placed
  804. after the sync pulse.  The horizontal numbers in the Xconfig line then become
  805.  
  806.     800 (800+68) (800+68+152) (800+68+152+68)
  807.  
  808.             or
  809.  
  810.         800 868 1020 1088
  811.  
  812. Now we want to calculate the vertical numbers.  To begin, we must remember
  813. that the vertical numbers are not in terms of dots or microseconds per dot,
  814. but are expressed as numbers of lines!  So we have to calculate how much time
  815. it takes to display a single line.  That's easy, because we know each line is
  816. 1088 dots and each dot is .025 microsecond.  Each line is, therefore,
  817.  
  818.      (1088 dots/line) x (.025 microseconds/dot) =
  819.                     27.2 microseconds/line
  820.  
  821. Since we chose 800 visible dots per line, let's choose the number of lines to
  822. be such that the ratio of horizontal to vertical is 4 to 3.  Thus, 800 is 4 x
  823. 200, so the number of visible lines should be 3 x 200 = 600.  Our target
  824. resolution is 800x600.
  825.  
  826. We know that a vertical sync pulse should be in the range of 50 to 300
  827. microseconds.  If we chose 150 microseconds as a typical sync pulse, we find
  828. how many lines 150 microseconds is by dividing 150 by 27.2 microseconds per
  829. line.
  830.  
  831.      (150 microseconds/pulse) / (27.2 microseconds/line) =
  832.             5.51 lines/pulse
  833.  
  834. By rounding up (never down) to 6 lines/pulse we now have the vertical sync
  835. pulse width.
  836.  
  837. To guess at the total number of lines per frame (illuminated lines plus
  838. nonilluminated lines in the border) we assume (from "Videotiming...") that the
  839. total number of lines will be 5% more than the number of viewable lines.  So
  840. the total number of lines is
  841.  
  842.      (600 lines) x (1.05) = 630 total lines per frame
  843.  
  844. So now we must place the pulse in the time between the end of the illuminated
  845. lines and the end of the frame.  Since we have 630 total lines, 600
  846. illuminated lines, and 6 lines for the pulse, we have
  847.  
  848.         630 - 600 - 6 = 24 lines left
  849.  
  850. Some displays don't mind if the pulse begins immediately after the illuminated
  851. lines, but others might want a line or two between the last illuminated line
  852. and the beginning of the sync pulse.  Taking the latter course just to be
  853. safe, we add three lines between the last illuminated line and the beginning
  854. of the pulse.  The rest of the lines are added after the pulse ends.  So the
  855. vertical timing numbers become
  856.  
  857.          600 (600+3) (600+3+6) (600+3+6+21)
  858.  
  859.             or
  860.  
  861.  
  862.                600 603 609 630
  863.  
  864. Before we do anything else, we must check that the display can handle 630
  865. lines/frame at 27.2 microseconds/line.  We do this by calculating how many
  866. frames per second our configuration will generate, and comparing it to the
  867. display manual's entry for vertical sync rate.  For 630 lines/frame at 27.2
  868. micro- seconds/line, we have 630 x 27.2 = 17,136 microseconds/frame.  17,136
  869. microseconds/frame is 0.017136 seconds/frame, or 1/0.017892 frames/second.
  870.  
  871.     1 / (0.017136 seconds/frame) = 58.4 frames/second
  872.  
  873. If the manual says the vertical sync rate is 58.4 Hz, or 58.4 Hz is in the
  874. range of the display's vertical sync rate, we are fine.  If the display cannot
  875. handle this rate, we'll have to change the number of lines per frame by
  876. adjusting all of the timings proportionally.
  877.  
  878. Now we combine the horizontal and vertical timing numbers together with the
  879. resolution and clock values to produce a test configuration for Xconfig.  Our
  880. line becomes
  881.  
  882.      "800x600"  40  800 868 1020 1088  600 603 609 630
  883.  
  884. Now we have a configuration of X386 to try.  It may not work if any of our
  885. assumptions were grossly wrong, but in most cases it should at least give us a
  886. stable display.  Now it takes a little experimentation to produce something
  887. pleasing.
  888.  
  889. An actual calculation
  890.  
  891. My adapter card has a 40 MHz crystal on it so I started with a 40
  892. MHz clock rate.  My display's maximum horizontal sync rate is 37
  893. KHz, so the minimum dots per line are 40,000,000/37,000 = 1081.
  894. My display's vertical sync rate is the range from 50 Hz to 90 Hz.
  895.  
  896. My display's manual says that the largest horizontal sync pulse
  897. is 3.92 microseconds.  With 0.025 microseconds per dot, the pulse
  898. is
  899.  
  900.     (3.92 microseconds) / (.025 microseconds/dot) =
  901.                         156.8 dots
  902.  
  903. Rounding this up to the nearest number evenly divisible by eight
  904. gives 160 dots.
  905.  
  906. The manual also says that the time between the last illuminated
  907. dot and the beginning of the sync pulse must be at least 0.67
  908. microseconds.  The number of dots in 0.67 microseconds at a 40
  909. MHz clock rate - remember 40 MHz is .025 microseconds/dot - is
  910.  
  911.     D dots = (0.67 microseconds) / (.025 microseconds/dot) =
  912.                         26.8 dots
  913.  
  914. Since 26.8 is not evenly divisible by eight, round it up to 32
  915. dots.
  916.  
  917. My display's manual says the time after the sync pulse should be
  918. 3.56 microseconds or more.  In dots, 3.56 microseconds is
  919.  
  920.     D dots = (3.56 microseconds) / (.025 microseconds/dot) =
  921.                         142.4 dots
  922.  
  923. Round 142.4 up to 144, so that it's evenly divisible by eight.
  924.  
  925. So now for a horizontal line we have 800 illuminated dots, 32
  926. dots between the illuminated dots and the sync pulse, 152 dots
  927. for the sync pulse, and 144 dots after the sync pulse.
  928.  
  929.     800 + 32 + 160 + 144 = 1136
  930.  
  931. We now have a line that is 1136 dots long.  This is greater than
  932. the 1088 we previously calculated, but remember that 1088 was the
  933. MINIMUM number of dots that could be on a line.  So 1136 dots per
  934. line is okay for starters.
  935.  
  936. The numbers to enter on the Xconfig line so far are
  937.  
  938.     "800x?"  40  800 (800+32) (800+32+160) (800+32+160+144)...
  939.  
  940.                 or
  941.  
  942.     "800x?"  40  800 832 992 1136...
  943.  
  944.  
  945. A line of 1136 dots at .025 microsecond/dot means that a line
  946. represents 1136 x .025 = 28.4 microseconds.
  947.  
  948. Since we chose 800 dots/line horizontal resolution, we choose 600
  949. lines/frame as the vertical resolution.
  950.  
  951. My display's manual says that the vertical sync pulse must be at
  952. least 64 microseconds long.  In terms of lines, 64 microseconds
  953. is
  954.  
  955.     (64 microseconds/pulse) / (28.4 microseconds/line) =
  956.                     2.25 lines/pulse
  957.  
  958. We round 2.25 up to 3 lines for the vertical sync pulse.
  959.  
  960. The manual says the time between the last displayed line and the
  961. start of the sync pulse must be at least 318 microseconds, and
  962. the delay after the end of the pulse must be at least 630
  963. microseconds.  We calculate how many lines each of these time
  964. periods represents as follows.
  965.  
  966.     (318 microseconds) / (28.4 microseconds/line) =
  967.                     11.20 lines
  968.  
  969.     (630 microseconds) / (28.4 microseconds/line) =
  970.                     22.18 lines
  971.  
  972. We round each of the times up to become 12 lines before the sync
  973. pulse and 23 lines after the pulse.  This makes our vertical
  974. timing numbers
  975.  
  976.     600 (600+12) (600+12+3) (600+12+3+23)
  977.  
  978.             or
  979.  
  980.         600 612 615 638
  981.  
  982. Checking the frame rate to see if it falls within the rate of the
  983. display, we see that 638 lines/frame at 28.4 microseconds/line is
  984. 18,119 microseconds/frame, which is 55.19 frames/second.  My
  985. display can handle anything from 50 Hz to 90 Hz, so the timing is
  986. all right.
  987.  
  988. Putting the resolution, clock, horizontal, vertical timing
  989. numbers together on a video mode line in Xconfig results in
  990.  
  991.     "800x600"  40  800 832 992 1136  600 612 615 638
  992.  
  993. This was the first video mode I tried.  It turned out not to be
  994. very satisfactory because there was too much flicker.  I tried
  995. other timings both above and below this setting as shown in the
  996. following example.  I finally settled on the "784x614" mode as a
  997. compromise between flicker and resolution.
  998.  
  999. You'll notice that almost all of the clock frequencies are 40
  1000. MHz.  Through experimentation I found that higher frequencies
  1001. were beyond my adapter card's capabilities, and that lower
  1002. frequencies didn't provide the resolution I wanted.
  1003.  
  1004. Example:
  1005.  
  1006.      Timings I have tried:
  1007.  
  1008.      # the following line works but is right of center
  1009.      "752x564"    40  752  784  944 1088  564 567 569 611
  1010.      #          44.5  752 792  976 1240  564 567 570 600
  1011.      #
  1012.      # this line fixes the problem with the previous line
  1013.      #"752x564"    40  752  816  976 1088  564 567 569 611
  1014.      #
  1015.      # trying to increase the vertical display size, it works
  1016.      #"752x614"    40  752  816  976 1088  614 617 619 661
  1017.      #
  1018.      # trying to increase the horiz. display size, it works
  1019.      #"784x564"    40  784  816  976 1088  564 567 569 611
  1020.      #
  1021.      # the following works but is to the right of center
  1022.      #"784x614"    40  784  816  976 1088  614 617 619 661
  1023.      #
  1024.      # the following corrects the uncentered problem of the previous one
  1025.      "784x614"    40  784  848 1008 1088  614 617 619 661
  1026.      #
  1027.      # trying to increase the display size
  1028.      # the following works, the display is slightly off center to the left
  1029.      #"800x614"    40  800  864 1024 1088  614 617 619 661
  1030.      #
  1031.      # the following corrects the problem of the previous entry
  1032.      "800x614"    40  800  864 1024 1104  614 617 619 661
  1033.      #
  1034.      # increase the display size, it works
  1035.      "816x614"    40  816  880 1040 1120  614 617 619 661
  1036.      #
  1037.      # increase the display size, it works
  1038.      "800x620"    40  800  864 1024 1104  620 623 625 661
  1039.      #
  1040.      # increase the display size, it works
  1041.      "816x620"    40  816  880 1040 1120  620 623 625 661
  1042.      #
  1043.      # increase the display size, it works
  1044.      "832x630"    40  832  896 1056 1136  630 633 635 661
  1045.      #
  1046.      # change the display size, it works but flickers badly
  1047.      "848x618"    40  848  912 1072 1152  618 621 623 661
  1048.  
  1049. 12. Fixing Problems with the Image.
  1050.  
  1051. OK, so you've got your X configuration numbers.  You put them in Xconfig with
  1052. a test mode label.  You fire up X, hot-key to the new mode, ... and the image
  1053. doesn't look right.  What do you do?  Here's a list of common problems and how
  1054. to fix them.
  1055.  
  1056. You *move* the image by changing the sync pulse timing.  You *scale* it by
  1057. changing the frame length (you need to move the sync pulse to keep it in
  1058. the same relative position, otherwise scaling will move the image as well).
  1059. Here are some more specific recipes:
  1060.  
  1061. The horizontal and vertical positions are independent.  That is, moving the
  1062. image horizontally doesn't affect placement vertically, or vice-versa.
  1063. However, the same is not quite true of scaling.  While changing the horizontal
  1064. size does nothing to the vertical size or vice versa, the total change in both
  1065. may be limited.  In particular, if your image is too large in both dimensions
  1066. you will probably have to go to a higher dot clock to fix it.  Since this
  1067. raises the usable resolution, it is seldom a problem!
  1068.  
  1069. The image is displaced to the left or right
  1070.  
  1071.     To fix this, move the horizontal sync pulse.  That is, increment or
  1072. decrement (by a multiple of 8) the middle two numbers of the horizontal timing
  1073. section that define the leading and trailing edge of the horizontal sync pulse.
  1074.  
  1075.      If the image is shifted left (right border too large, you want to move
  1076. the image to the right) decrement the numbers.  If the image is shifted right
  1077. (left border too large, you want it to move left) increment the sync pulse.
  1078.  
  1079. The image is displaced up or down
  1080.  
  1081.     To fix this, move the vertical sync pulse.  That is, increment or
  1082. decrement the middle two numbers of the vertical timing section that define
  1083. the leading and trailing edge of the vertical sync pulse.
  1084.  
  1085.      If the image is shifted up (lower border too large, you want to move
  1086. the image down) decrement the numbers.  If the image is shifted down
  1087. (top border too large, you want it to move up) increment the numbers.
  1088.  
  1089. The image is too wide (too narrow) horizontally
  1090.  
  1091.      To fix this, increase (decrease) the horizontal frame length.  That is,
  1092. change the fourth number in the first timing section.  To avoid moving the
  1093. image, also move the sync pulse (second and third numbers) half as far,
  1094. to keep it in the same relative position.
  1095.  
  1096. The image is too deep (too shallow) vertically
  1097.  
  1098.     To fix this, decrease (increase) the vertical frame length.  That is,
  1099. change the fourth number in the second timing section.  To avoid moving the
  1100. image, also move the sync pulse (second and third numbers) half as far,
  1101. to keep it in the same relative position.
  1102.  
  1103. Any distortion that can't be handled by combining these techniques is probably
  1104. evidence of something more basically wrong, like a calculation mistake or a
  1105. faster dot clock than the monitor can handle.
  1106.  
  1107. Finally, remember that increasing either frame length will decrease your
  1108. refresh rate, and vice-versa.
  1109.  
  1110.  
  1111. $XFree86: mit/server/ddx/x386/etc/VideoModes.doc,v 2.0 1993/10/08 15:58:29 dawes Exp $
  1112.